package com.qf.feign.factory;

import com.qf.feign.CustomerFeign;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author lixu
 */
@Component
public class CustomerFeignFactory implements FallbackFactory<CustomerFeign> {
    @Override
    public CustomerFeign create(Throwable throwable) {
        return new CustomerFeign() {
            @Override
            public String list(Integer id) {
                return "我是消费者的降级处理";
            }
            public String a() {
                return "我是a降级处理";
            }
        };
    }
}
